package com.hxx.intercepor;

import com.hxx.interceptor.MemberInterceptor;
import jakarta.annotation.Resource;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * mvc配置类
 */
@Configuration
public class SpringMvcConfig implements WebMvcConfigurer {

    //使用common模块中的拦截器
    @Resource
    private MemberInterceptor memberInterceptor;

    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(memberInterceptor)
                .excludePathPatterns("/train-member/login","/train-member/sendCode")
                .addPathPatterns("/**");
    }
}





















